public class Demo2 {
    public static void main(String[] args) throws InterruptedException {
        Object o1 = new Object();
        Object o2 = new Object();
        synchronized (o1){
            System.out.println("111");
            o1.wait();
            System.out.println("222");
        }
    }
}
